<?php

namespace App\Http\Controllers\my;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Model\Project;
use DB;
use Auth;

class IndexController extends Controller
{
    public function index(){
        $pro = DB::table('projects')->where('status',1)->get();
        return view('My.index',['pro'=>$pro]);
    }

    public function pay(Request $r){
    	$info = array(
    		'v_mid'=>'20272562',
    		'v_oid'=>date('YmdHis').mt_rand(1000,9999),
    		'v_amount'=>$r->money,
    		'v_moneytype'=>'CNY',
    		'v_url'=>'http://buerdai.com/bid/bid/'.$r->pid,
    		'v_key'=>'%()#QOKFDLS:1*&U',
			);
    	 $info['v_md5info']=strtoupper(md5($info['v_amount'].$info['v_moneytype'].$info['v_oid'].$info['v_mid'].$info['v_url'].$info['v_key']));
    	return view('My.pay',$info);
    }

}
